package com.ailsa.learningsystem.reflex;

import com.sun.xml.internal.bind.v2.runtime.output.SAXOutput;

/**
 * @Author 冉冉
 * @Version 1.0
 * 获取字节码对象的方式：
 * 1.Class.forName
 * 2.类名.class
 * 3.对象名称.getClass
 * Java中有一个包，Java.lang包不需要导包
 */

public class ReflexDemo01 {
    public static void main(String[] args) throws Exception{
        //1.Class.forName获取字节码对象
        Class clazz=Class.forName("com.ailsa.learningsystem.reflex.Person");
        System.out.println(clazz);
        //2.类名.class
        /*Class<Person> personClass = Person.class;
        System.out.println(personClass);*/
        //3.对象名称.getClass
       /* Person person=new Person();
        Class aClass = person.getClass();
        System.out.println(aClass);*/
    }
}
